package com.lej.my.http

import com.google.gson.JsonObject
import com.lej.dataservice.club.bean.main.my.MyCollectRes
import com.lej.dataservice.club.bean.main.my.MySpaceRes
import com.lej.dataservice.club.bean.main.my.MyUserInfoAll
import com.lej.dataservice.club.http.BaseResponse
import com.lej.dataservice.club.http.RetrofitClient
import okhttp3.RequestBody
import retrofit2.http.*

/**
 *  author: cjq
 *  date  : 2022/4/19 0019
 *  desc  :
 */
val myApiService: MyApiService = RetrofitClient.getInstance().create(MyApiService::class.java)

interface MyApiService {
    /**获取用户信息*/
    @Headers("Content-Type: application/json")
    @GET("/trove/nfthouse/userinfo")
    suspend fun getUserInfo(): BaseResponse<MyUserInfoAll>

    /**
     * 修改用户信息
     */
    @Headers("Content-Type: application/json")
    @POST("/trove/users/update")
    suspend fun updateInfo(@Body body: RequestBody): BaseResponse<JsonObject>

    /**
     * 我的数字文创列表
     */
    @Headers("Content-Type: application/json")
    @POST("/trove/nftBackpack/appMyList")
    suspend fun getMyCollect(@Body body: RequestBody): BaseResponse<MyCollectRes>

    /**
     * 首页（app）发现，宝藏屋列表
     */
    @Headers("Content-Type: application/json")
    @POST("/trove/nfthouse/appfind")
    suspend fun getMySpace(): BaseResponse<MySpaceRes>

    /**
     * 获取未读求购消息
     */
    @Headers("Content-Type: application/json")
    @GET("/trove/nFTTransfer/unreadNum")
    suspend fun getUnReadMsg(): BaseResponse<JsonObject>


    /**
     * 副本-出示权益二维码
     */
    @Headers("Content-Type: application/json")
    @GET("/trove/rights/jumpurl")
    suspend fun getQrCode(): BaseResponse<JsonObject>


    /**
     * 合成消息已读
     */
    @Headers("Content-Type: application/json")
    @GET("/trove/nFTTransfer/readedCompose")
    suspend fun sendHasRead(): BaseResponse<JsonObject>


    /**注销登录*/
    @Headers("Content-Type: application/json")
    @POST("trove/users/cencelUser")
    suspend fun logout(): BaseResponse<JsonObject>


    /**获取余额*/
    @Headers("Content-Type: application/json")
    @POST("trove/withdraw/availableBalance")
    suspend fun getBalance(): BaseResponse<JsonObject>

    /**申请提现*/
    @Headers("Content-Type: application/json")
    @POST("trove/withdraw/add")
    suspend fun withDraw(@Body body: RequestBody): BaseResponse<JsonObject>

    /**
     * 获取提现规则
     */
    @Headers("Content-Type: application/json")
    @GET("trove/client/config_data")
    suspend fun withDrawRule(
        @Query("tags[]") list: List<String>,
        @Query("version") version: String
    ): BaseResponse<JsonObject>
}